import React, {Component} from 'react';
import {
  View,
  Text,
  Alert,
  Button,
  ToastAndroid,
  TextInput,
  StyleSheet,
  Dimensions,
  TouchableOpacity,
  ScrollView,
  Image,
} from 'react-native';
let widthScreen = Dimensions.get('window').width;
let heightScreen = Dimensions.get('window').height;

export default class Avatar extends Component {
  static defaultProps = {
    title: '',
    marginTop: 0,
    marginRight: 0,
    marginLeft: 0,
    pictureUrl: 'empty',
    uid: -1,
  };
  constructor(props) {
    super(props);
    this.state = {
      username: '',
    };
  }
  render() {
    let pressFunc = this.props.pressFunc;
    return (
      <TouchableOpacity onPress={() => pressFunc()}>
        <View
          style={{
            backgroundColor: '#CCCCCC',
            width: heightScreen * 0.038,
            height: heightScreen * 0.038,
            borderRadius: heightScreen * 0.019,
            marginTop: this.props.marginTop,
            marginRight: this.props.marginRight,
            marginLeft: this.props.marginLeft,
          }}>
          <Image
            source={{uri: this.props.pictureUrl}}
            style={{
              width: heightScreen * 0.038,
              height: heightScreen * 0.038,
              borderRadius: heightScreen * 0.019,
            }}
          />
        </View>
      </TouchableOpacity>
    );
  }
}
